package top.zy.service.zymallgoodsinterface.api;

import org.springframework.web.bind.annotation.*;
import top.zy.common.zymallcommon.vo.PageResult;
import top.zy.service.zymallgoodsinterface.dto.GoodsPageParam;
import top.zy.service.zymallgoodsinterface.dto.GoodsParams;
import top.zy.service.zymallgoodsinterface.dto.SpuParam;
import top.zy.service.zymallgoodsinterface.entity.SpuDetail;
import top.zy.service.zymallgoodsinterface.vo.GoodsVo;
import top.zy.service.zymallgoodsinterface.vo.SkuVo;

import java.util.List;

/**
 * @Author: HouZeYu
 * @Description:
 * @Date: Created in 14:44 2019/7/2
 */
public interface GoodsApi {
    /**
     * 分页查询spu信息
     * @param
     * @return
     */
     @GetMapping("spu/page")
     PageResult<GoodsVo> queryGoodsPage(@RequestParam("page") Integer page,@RequestParam("rows") Integer rows,@RequestParam("key") String key,@RequestParam("saleable") Boolean saleable,@RequestParam("id") Long id);
    /**
     * 根据id查询spu详情
     * @param id
     * @return
     */
    @GetMapping("spu/detail/{id}")
     SpuDetail querySpuDetailById(@PathVariable("id") Long id);

    /***
     * 根据spuId查询sku集合
     * @param id
     * @return
     */
    @GetMapping("sku/list/{id}")
     List<SkuVo> querySkuBySpuId(@PathVariable("id") Long id);

    /***
     * 根据spuId查询spu
     * @param id
     * @return
     */
    @GetMapping("spu/{id}")
    GoodsVo querySpuBySpuId(@PathVariable("id") Long id);

}
